<?
/****************************************/
/************* IdeaLAN LLC **************/
/* display page links, like next, prev  */
/* Params:                              */
/* $result, $begin, $linktest,          */
/* $rows_on_page                        */
/****************************************/
$p = new Pagination();
$page_nr = floor( $begin / $rows_on_page );
$arr = $p->calculate_pages( $result, $rows_on_page, $page_nr );

$link_first = "<a href=\"$linktest&begin=0\"> FIRST </a> ";
$link_prev = "<a href=\"$linktest&begin=".$arr['prevBegin']."\"> PREV </a> ";
$link_next = "<a href=\"$linktest&begin=".$arr['nextBegin']."\"> NEXT </a> ";
$link_last = "<a href=\"$linktest&begin=".$arr['lastBegin']."\"> LAST </a> ";

$pagingStr = "<center>";
if($arr['prevBegin']!=0 && $arr['begin']!=0) {
    $pagingStr = $pagingStr.$link_first." |";
}
if($arr['begin']!=0) {
    $pagingStr = $pagingStr.$link_prev." |";
}
$pageNr = $arr['current']+1;
$pagingStr = $pagingStr." <u>".$pageNr."</u> ";
if($arr['nextBegin'] < $arr['lastBegin']) {
    $pagingStr = $pagingStr."| $link_next ";
}
if($arr['begin'] < $arr['lastBegin']) {
    $pagingStr = $pagingStr."| $link_last";
}

$pagingStr = $pagingStr."</center>";


?>